import mongoose from 'mongoose'

expect.extend({
  toBeValidId(received: string) {
    const pass = mongoose.Types.ObjectId.isValid(received)
    return {
      message: () => `expected ${received} to be${pass ? ' not' : ''} a valid MongoDB ID`,
      pass,
    }
  },
})
